﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Phone_OffineCameralContol : MonoBehaviour
{
    private CharacterController cc;
    public float moveSpeed = 5;
    private float horizontalWrapMode, verticalMove;
    private Vector3 dir;
    public Joystick joystick;

    private void Awake()
    {
        cc = GetComponent<CharacterController>();
    }


    // Update is called once per frame
    void Update()
    {
        horizontalWrapMode = joystick.Horizontal * moveSpeed;
        //verticalMove = joystick.Vertical * moveSpeed;
        dir = transform.forward * verticalMove;

        transform.Rotate(0, horizontalWrapMode / 5, 0);


        cc.Move(dir * Time.deltaTime);
    }
}
